﻿using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Infrastructure.ElasticSearch.ParentChilds
{
    public class EsJsonSerializerSettings : JsonSerializerSettings
    {
        public EsJsonSerializerSettings() : base()
        {
            DefaultValueHandling = DefaultValueHandling.Ignore;
            NullValueHandling = NullValueHandling.Ignore;
            DateFormatString = "yyyy-MM-dd HH:mm:ss";
            ContractResolver = new CamelCasePropertyNamesContractResolver();
            Converters.Add(new JsonArrayToNullConverter());
        }
    }
}
